{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Feature Engineering\n",
    "## Numerical and Categorical Data\n",
    "\n",
    "This notebook show cases some of the common methods for feature extraction and engineering on numerical and categorical data types."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Important Imports"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from collections import Counter\n",
    "\n",
    "# pandas display data frames as tables\n",
    "from IPython.display import display, HTML\n",
    "\n",
    "# plotting\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "\n",
    "# setting params\n",
    "params = {'legend.fontsize': 'x-large',\n",
    "          'figure.figsize': (30, 10),\n",
    "          'axes.labelsize': 'x-large',\n",
    "          'axes.titlesize':'x-large',\n",
    "          'xtick.labelsize':'x-large',\n",
    "          'ytick.labelsize':'x-large'}\n",
    "\n",
    "sns.set_style('whitegrid')\n",
    "sns.set_context('talk')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Feature Engineering : Numerical Data \n",
    "The dataset utilized for numerical features is the credit card default dataset from UCI (available [here](https://archive.ics.uci.edu/ml/datasets/default+of+credit+card+clients))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(30000, 24)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# load dataset \n",
    "credit_df = pd.read_excel('credit_default.xls',\n",
    "                             skiprows=1,index_col=0)\n",
    "credit_df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>LIMIT_BAL</th>\n",
       "      <th>SEX</th>\n",
       "      <th>EDUCATION</th>\n",
       "      <th>MARRIAGE</th>\n",
       "      <th>AGE</th>\n",
       "      <th>PAY_0</th>\n",
       "      <th>PAY_2</th>\n",
       "      <th>PAY_3</th>\n",
       "      <th>PAY_4</th>\n",
       "      <th>PAY_5</th>\n",
       "      <th>...</th>\n",
       "      <th>BILL_AMT4</th>\n",
       "      <th>BILL_AMT5</th>\n",
       "      <th>BILL_AMT6</th>\n",
       "      <th>PAY_AMT1</th>\n",
       "      <th>PAY_AMT2</th>\n",
       "      <th>PAY_AMT3</th>\n",
       "      <th>PAY_AMT4</th>\n",
       "      <th>PAY_AMT5</th>\n",
       "      <th>PAY_AMT6</th>\n",
       "      <th>default payment next month</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20000</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>24</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>-1</td>\n",
       "      <td>-1</td>\n",
       "      <td>-2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>689</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>120000</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>26</td>\n",
       "      <td>-1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>3272</td>\n",
       "      <td>3455</td>\n",
       "      <td>3261</td>\n",
       "      <td>0</td>\n",
       "      <td>1000</td>\n",
       "      <td>1000</td>\n",
       "      <td>1000</td>\n",
       "      <td>0</td>\n",
       "      <td>2000</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>90000</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>34</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>14331</td>\n",
       "      <td>14948</td>\n",
       "      <td>15549</td>\n",
       "      <td>1518</td>\n",
       "      <td>1500</td>\n",
       "      <td>1000</td>\n",
       "      <td>1000</td>\n",
       "      <td>1000</td>\n",
       "      <td>5000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>50000</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>37</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>28314</td>\n",
       "      <td>28959</td>\n",
       "      <td>29547</td>\n",
       "      <td>2000</td>\n",
       "      <td>2019</td>\n",
       "      <td>1200</td>\n",
       "      <td>1100</td>\n",
       "      <td>1069</td>\n",
       "      <td>1000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>50000</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>57</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>20940</td>\n",
       "      <td>19146</td>\n",
       "      <td>19131</td>\n",
       "      <td>2000</td>\n",
       "      <td>36681</td>\n",
       "      <td>10000</td>\n",
       "      <td>9000</td>\n",
       "      <td>689</td>\n",
       "      <td>679</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    LIMIT_BAL  SEX  EDUCATION  MARRIAGE  AGE  PAY_0  PAY_2  PAY_3  PAY_4  \\\n",
       "ID                                                                         \n",
       "1       20000    2          2         1   24      2      2     -1     -1   \n",
       "2      120000    2          2         2   26     -1      2      0      0   \n",
       "3       90000    2          2         2   34      0      0      0      0   \n",
       "4       50000    2          2         1   37      0      0      0      0   \n",
       "5       50000    1          2         1   57     -1      0     -1      0   \n",
       "\n",
       "    PAY_5             ...              BILL_AMT4  BILL_AMT5  BILL_AMT6  \\\n",
       "ID                    ...                                                \n",
       "1      -2             ...                      0          0          0   \n",
       "2       0             ...                   3272       3455       3261   \n",
       "3       0             ...                  14331      14948      15549   \n",
       "4       0             ...                  28314      28959      29547   \n",
       "5       0             ...                  20940      19146      19131   \n",
       "\n",
       "    PAY_AMT1  PAY_AMT2  PAY_AMT3  PAY_AMT4  PAY_AMT5  PAY_AMT6  \\\n",
       "ID                                                               \n",
       "1          0       689         0         0         0         0   \n",
       "2          0      1000      1000      1000         0      2000   \n",
       "3       1518      1500      1000      1000      1000      5000   \n",
       "4       2000      2019      1200      1100      1069      1000   \n",
       "5       2000     36681     10000      9000       689       679   \n",
       "\n",
       "    default payment next month  \n",
       "ID                              \n",
       "1                            1  \n",
       "2                            1  \n",
       "3                            0  \n",
       "4                            0  \n",
       "5                            0  \n",
       "\n",
       "[5 rows x 24 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit_df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  Extract Raw Features\n",
    "Attributes which are useful in their raw form itself"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>LIMIT_BAL</th>\n",
       "      <th>BILL_AMT1</th>\n",
       "      <th>BILL_AMT2</th>\n",
       "      <th>BILL_AMT3</th>\n",
       "      <th>BILL_AMT4</th>\n",
       "      <th>BILL_AMT5</th>\n",
       "      <th>BILL_AMT6</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20000</td>\n",
       "      <td>3913</td>\n",
       "      <td>3102</td>\n",
       "      <td>689</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>120000</td>\n",
       "      <td>2682</td>\n",
       "      <td>1725</td>\n",
       "      <td>2682</td>\n",
       "      <td>3272</td>\n",
       "      <td>3455</td>\n",
       "      <td>3261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>90000</td>\n",
       "      <td>29239</td>\n",
       "      <td>14027</td>\n",
       "      <td>13559</td>\n",
       "      <td>14331</td>\n",
       "      <td>14948</td>\n",
       "      <td>15549</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>50000</td>\n",
       "      <td>46990</td>\n",
       "      <td>48233</td>\n",
       "      <td>49291</td>\n",
       "      <td>28314</td>\n",
       "      <td>28959</td>\n",
       "      <td>29547</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>50000</td>\n",
       "      <td>8617</td>\n",
       "      <td>5670</td>\n",
       "      <td>35835</td>\n",
       "      <td>20940</td>\n",
       "      <td>19146</td>\n",
       "      <td>19131</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    LIMIT_BAL  BILL_AMT1  BILL_AMT2  BILL_AMT3  BILL_AMT4  BILL_AMT5  \\\n",
       "ID                                                                     \n",
       "1       20000       3913       3102        689          0          0   \n",
       "2      120000       2682       1725       2682       3272       3455   \n",
       "3       90000      29239      14027      13559      14331      14948   \n",
       "4       50000      46990      48233      49291      28314      28959   \n",
       "5       50000       8617       5670      35835      20940      19146   \n",
       "\n",
       "    BILL_AMT6  \n",
       "ID             \n",
       "1           0  \n",
       "2        3261  \n",
       "3       15549  \n",
       "4       29547  \n",
       "5       19131  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit_df[['LIMIT_BAL','BILL_AMT1',\n",
    "                   'BILL_AMT2','BILL_AMT3',\n",
    "                   'BILL_AMT4','BILL_AMT5',\n",
    "                   'BILL_AMT6']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Counts\n",
    "Based on requirements, count of events is also a useful attribute.\n",
    "For instance, in the credit defaulters dataset, knowing *how many times a person has defaulted* may be a useful feature."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# utility function\n",
    "def default_month_count(row):\n",
    "    count = 0 \n",
    "    for i in [0,2,3,4,5,6]:\n",
    "        if row['PAY_'+str(i)] > 0:\n",
    "            count +=1\n",
    "    return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "credit_df['number_of_default_months'] = credit_df.apply(default_month_count,axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>number_of_default_months</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    number_of_default_months\n",
       "ID                          \n",
       "1                          2\n",
       "2                          2\n",
       "3                          0\n",
       "4                          0\n",
       "5                          0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit_df[['number_of_default_months']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Binarization\n",
    "Occurance or absence of an event is also a useful feature"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>number_of_default_months</th>\n",
       "      <th>has_ever_defaulted</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    number_of_default_months  has_ever_defaulted\n",
       "ID                                              \n",
       "1                          2                   1\n",
       "2                          2                   1\n",
       "3                          0                   0\n",
       "4                          0                   0\n",
       "5                          0                   0"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit_df['has_ever_defaulted'] = credit_df.number_of_default_months.apply(lambda x: 1 if x>0 else 0)\n",
    "credit_df[['number_of_default_months','has_ever_defaulted']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "### Binning\n",
    "Also known as quantization, helps in transformin continuous features such as age and income onto discrete scales."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x24e4188c048>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAoYAAAHECAYAAACk8uuDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9clfXdx/E3cvQcyFTulO5c5hDMlBIUSSoWpJZKIJW6\nFmWEdw4mW7sxrUzNbtHbWsGitlKbNi2WTe4SMJZkym6X0yJNF8sW41Q6c3VmUuLhh4fr/qPjuSV/\ngHLOdQRez8fDB3J9L67rc304XL79XpzrCjAMwxAAAAC6vG7+LgAAAADnB4IhAAAAJBEMAQAA4EYw\nBAAAgCSCIQAAANwIhgAAAJBEMATQyTU1NSk+Pl7/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VK3XllVdqxIgRnj+VlZX02wcOHjyozMxMjRw5\nUtdff73WrFkjide2t5WUlLR4PY8YMUJXXHGFFixYQK99YOfOnbrttts0cuRIjR8/XqWlpZJ8/Lo2\ncEqHDx82YmNjjZKSEsPlchkffPCBERsba7z99tvGz372M2P27NlGfX29sXv3buPqq682du3a5e+S\nO6yamhojKirKeO+99wzDMIy3337biIyMNP71r3/Rax/58Y9/bFxxxRXG5s2bDcMw6LOPzJo1y/jN\nb35z0nL67V3Nzc3Grbfeajz22GNGY2Oj8be//c2IjY013nvvPXrtY2+//bZx3XXXGZ9//jm99rJj\nx44ZcXFxxh/+8AfDMAzj3XffNYYNG2bs27fPp71mxvA0Dhw4oISEBKWkpKhbt26KjIzU6NGjtXPn\nTm3atEn33XefrFarhg8fruTkZK1fv97fJXdYYWFhevvttzVy5EgdO3ZMDodDF1xwgXr06EGvfeDl\nl19WUFCQLrnkEklSXV0dffaRDz/8UEOHDm2xjH573+7du/XFF19o9uzZ6t69uwYPHqy1a9fq4osv\nptc+VFdXp4ceekiPPvqoLrzwQnrtZV9//bUOHTokl8slwzAUEBCg7t27KzAw0Ke9JhiextChQ/XE\nE094Pq+trVVlZaUkyWKxaMCAAZ6xsLAw1dTUmF5jZ3LBBRdo3759Gj58uB544AHl5OTos88+o9de\nZrfb9cILL+jRRx/1LPv000/psw84nU7Z7XatWbNG1113nSZOnKiioiL67QNVVVUaPHiwnnjiCV13\n3XUaP368du/erdraWnrtQ7/5zW90+eWXa9y4cbyufSAkJERpaWmaNWuWIiMjdeedd2rBggX66quv\nfNprgmEbfPPNN8rKyvLMGtpsthbjNptN9fX1fqqu87jkkku0e/duvfDCC3r88ce1efNmeu1Fx44d\n0wMPPKB58+apT58+nuVHjx6lzz7gcDgUExOjO+64Q1u2bFFubq4ee+wxbdmyhX57WW1trXbs2KGQ\nkBBt2bJFS5cuVW5uLq9tH6qrq9NLL72kn/70p5I4j/hCc3OzbDabCgoK9P7772vZsmX67//+bx05\ncsSnvSYYtm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/XbbfdptTUVBUVFXnWLSgo0Lhx4zR16lQ9\n/vjjmjZtmiTpoYce0sqVKz3rnfj5P//5T2VnZ+u2225TSkqKli1bJknav3+/xo0bp9zcXE2ZMkU3\n3nijysrKJEnHjh3T0qVLNX78eCUlJWnevHlqbGzU+PHj9ac//cmzn/nz52v16tU+7xGAzoMZQwCQ\nlJ6e3uJS8qpVq3TRRRepqalJN9xwgwoKCnTs2DGlpqbqF7/4hSIjI/XNN9/o9ttvV0REhL744guV\nl5dr/fr1slqtmjlzZpv2O2fOHN1zzz0aM2aMGhoaNGPGDF122WUaPny49u3bp/j4eC1YsEAbN27U\nY489pqSkJP3ud79TVVWViouL1aNHD82aNUtlZWW64447tG7dOsXHx+vIkSN666239MADD/iqZQA6\nIYIhAOjMl5JHjRolSfrkk0/02Wef6eGHH/aM1dfX669//auqq6t14403qmfPnpKk22+/vdXZuqNH\nj+rdd99VbW2tCgoKPMv27t2r4cOHq3v37kpISJAkDRs2TIcPH5Ykbdu2TampqbLZbJKkp556SpL0\n9ddf69e//rUOHTqkN954Q4mJierVq9e5tgRAF0QwBIBWBAcHS5JcLpd69eql4uJiz5jD4dCFF16o\np556Sic+er579+6evwcEBLQYa2pqkiQ1NzfLMAytXbtWQUFBkqRDhw7JarXqq6++Uvfu3T2zmAEB\nAZ6vt1hanrodDoeam5sVGhqqCRMmqKSkRKWlpVq4cKG3WgCgi+B3DAGgjcLCwmS1Wj3B8PPPP1dy\ncrI++OADJSYm6o033lBtba2am5u1fv16z9eFhITogw8+kPRt8KusrJQk9ezZU9HR0XrhhRckfTvj\nd8cdd+itt946Yx3XXHONNmzYoMbGRjU3N+vRRx/V66+/Lkm68847tWbNGhmGoeHDh3u9BwA6N2YM\nAaCNevTooWeffVZLlizRb37zGx07dkw///nPFRMTI0m6++67lZaWJqvVqu9973uer5s2bZpmz56t\n8ePH69JLL9XVV1/tGXvyySeVm5urlJQUNTY2Kjk5WZMmTdL+/ftPW8ePfvQj/eMf/9Btt90mwzB0\n9dVXe97ocsUVV6h379760Y9+5KMuAOjMAowTr28AALzijTfeUGFhoV588UVT9/vZZ59p2rRpeuON\nNzyXpwGgrbiUDACdREFBge644w49+OCDhEIA54QZQwAAAEhixhAAAABuBEMAAABIIhgCAADAjWAI\nAAAASQRDAAAAuBEMAQAAIEn6P493ONmff5ktAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x24e4205ae10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "credit_df.AGE.plot(kind='hist',bins=60)\n",
    "plt.title('Age Histogram', fontsize=12)\n",
    "plt.ylabel('Age', fontsize=12)\n",
    "plt.xlabel('Frequency', fontsize=12)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Fixed Width Bins"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Fixed Width Bins :\n",
    "\n",
    "``` \n",
    "Age Range: Bin\n",
    "---------------\n",
    " 0 -  9  : 0\n",
    "10 - 19  : 1\n",
    "20 - 29  : 2\n",
    "30 - 39  : 3\n",
    "  ... and so on\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Assign a bin label to each row\n",
    "credit_df['age_bin_fixed'] = credit_df.AGE.apply(lambda age: np.floor(age/10.))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>AGE</th>\n",
       "      <th>age_bin_fixed</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>24</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>26</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>37</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>57</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    AGE  age_bin_fixed\n",
       "ID                    \n",
       "1    24            2.0\n",
       "2    26            2.0\n",
       "3    34            3.0\n",
       "4    37            3.0\n",
       "5    57            5.0"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit_df[['AGE','age_bin_fixed']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Quantile Based Binning\n",
    "* 4-Quartile Binning"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.00    21.0\n",
       "0.25    28.0\n",
       "0.50    34.0\n",
       "0.75    41.0\n",
       "1.00    79.0\n",
       "Name: AGE, dtype: float64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## Quantile binning\n",
    "quantile_list = [0, .25, .5, .75, 1.]\n",
    "quantiles = credit_df.AGE.quantile(quantile_list)\n",
    "quantiles"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Plot Quartile Ranges on the Distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x24e3ee17940>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAoYAAAHECAYAAACk8uuDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3X1cVGX+//E3MjIDayrlzequtQjkDXmXmlYWrjepBFKp\nrUupi+lCuuuGqUXmzzY0aws2unFT07Ybs9I1UbO8KelGVws1b9i8QUbNVTeJotRhwOH8/nCcryjI\nKHMj8Ho+Hj6YOdeZc67zOYfjm+vMnAkwDMMQAAAA6rx6/u4AAAAArgwEQwAAAEgiGAIAAMCJYAgA\nAABJBEMAAAA4EQwBAAAgiWAIoJpKS0vVq1cvPfDAAx5d7ubNmxUbG3vB9EcffVTz58+XJI0dO1Z5\neXkXXc7o0aNVWFjo0b75Wnx8vH766Sf9/PPPGjlypGt6mzZt3N62NWvWaPjw4YqJiVFcXJzGjx+v\n3bt3e6vL2rFjh/7f//t/kqSdO3dqwoQJksrvPwBXHpO/OwCgZlu7dq3atGmj3Nxc7d+/X+Hh4T5b\n97x586qcZ8OGDT7oiXdlZWVJkg4fPqydO3de8uvffvttLVq0SM8//7xr/3z66ad64IEHNHfuXEVF\nRXm0v5KUl5en//3vf5KkDh066IUXXvD4OgB4HiOGAKpl0aJF6tevn2JiYvT666+7ps+dO1d33HGH\n7r77bs2cOVN9+vSRJJWUlOipp57S3XffrcGDB+vRRx/ViRMnLmvdffr00c6dO3Xy5ElNmDBB8fHx\nuvvuu/X444+rrKxMqampkqRRo0bp6NGj2rdvn0aMGKG4uDgNHjxYy5Ytq7K/jz76qJKTk3XnnXfq\n2WefldVqVWJion73u9/pt7/9rR588EHZ7XZJZwJQenq64uLi9Nvf/larVq3ShAkTNHDgQI0cOVKn\nTp0q1//du3crOjra9fyBBx7QlClTXHXq0aOHfvrpJ9fIYGpqqoqLixUfHy+HwyFJevHFF3XPPfeo\nT58+Wrhw4QU1KikpUWZmpp5++ulyoT06Olpjx47V888/79rOc0fyzn2+fv16DR8+XPfcc4969+7t\nes3mzZs1fPhwTZ48WXfddZdiYmK0adMmHT16VC+88IJycnKUmppa6ejv/v37NXr0aN1zzz2Kj4/X\nkiVLJKnS/QnA+wiGAC5bXl6evv76aw0aNEh33XWXsrKy9MMPP+jzzz/X0qVLtWTJEi1dulQnT550\nvWbu3LkKDAzU0qVLtXz5cjVr1kzPPfdchcs/dOiQ4uPjy/375JNPLphv7dq1OnnypLKyslzh4ttv\nv9WsWbMkSa+//rqaNm2qBx98UCNGjNCKFSs0b948ZWRkaNu2bRftryQVFxfrgw8+0OTJk/Xee+/p\nrrvu0rvvvqs1a9bo8OHDys7OlnQmhDVt2lQrVqzQ73//ez3++OOaOnWqVq1apRMnTujjjz8ut9y2\nbdvKZDJp7969Ki4ultVq1ebNmyVJ//73v9WxY0c1bNjQNf+sWbNksViUlZWlwMBASVKrVq20dOlS\nvfTSS3r66adVWlp6wT4qLS2tcFTwlltu0datWyus/VmGYWjBggV6+umntXTpUr377ruaO3eu6xL2\njh07NHr0aC1btkxDhw7VSy+9pBYtWmjChAnq1q2bax+c7/Tp05owYYIefvhhLV26VG+99ZYWLFig\nr7/+utL9CcD7uJQM4LItWrRIvXv3VuPGjdW4cWP9+te/1rvvvquCggINHDjQFWruu+8+bdq0SZKU\nnZ2tn3/+WRs3bpR05j2K11xzTYXLv/baa12XUc969NFHL5iva9eu+vvf/64RI0bolltu0ahRo3Td\nddeVm+fAgQOy2+264447JEnNmzfXHXfcoc8//1w//fRTpf09u/yzJk+erA0bNmjevHk6cOCAvvvu\nu3IjgQMGDHD1/frrr1fz5s0lSb/+9a9VVFR0Qd/79++vzz77TNdff7169OihPXv2aN++ffr4449d\nfb2YsyNx7dq1U0lJiU6cOKHQ0NAqX3dWVSNxAQEBeuWVV5Sdna2VK1dq//79MgxDNptNktSyZUu1\na9dOktS+fXu9//77bq33wIEDOnTokB577DHXtOLiYv3nP//RbbfdVuX+BOAdBEMAl+XUqVNatmyZ\nzGaz67LriRMntHDhQt15550692vYz45uSWeCyGOPPea6hHry5EnXpdjL1apVK61du1abN2/Wpk2b\nlJiYqMcff1wDBw4st97zGYah06dPy2QyVdpfSQoJCXE9njhxohwOhwYNGqTevXvr6NGj5V5bv379\nCh9Xpn///nr++ef13Xff6dZbb9U111yjL774Qp999pkeeuihKl9vMp05jQcEBLi26VwREREymUza\ntWuXbrjhBknS//73PzVv3lybNm1S586dXa8/97VnRx5PnTqlu+++W/369VO3bt00ZMgQrVu3zjWv\nxWJxveb8ZVyMw+FQw4YNywX/goICXXXVVTKbzVXuTwDewaVkAJdlxYoVCg0N1eeff65PPvlEn3zy\nidatW6dTp06pffv2WrNmjX7++WdJcl0OlKRevXpp4cKFKikpUVlZmaZNm6aMjIxq9eXtt99Wamqq\nevXqpcmTJ6tXr17at2+fpDMh7/Tp0woLC1P9+vW1Zs0aSWfC0erVq3XLLbcoOjq60v6e74svvtD4\n8eMVExOjgIAAbd++3fV+v8vRpUsXHTp0SNnZ2brlllt066236vXXX9dvfvMbXX311eXmNZlMcjgc\nbocvSQoKCtLEiROVmpqq/fv3y+FwaNKkSRo7dqzmzp3rCp+hoaHatWuXJKmwsFA5OTmSpIMHD+rE\niRN66KGH1KdPH3355ZeufXcxZ+tembCwMJnNZlcwPHr0qGJjY7Vr166L7k8A3sWIIYDLsmjRIiUm\nJpYbXWvYsKFGjBih119/Xffee69+97vfyWKxKDIyUsHBwZKkcePG6ZlnntHdd98th8Ohdu3aVXh5\n+FLcdddd+vLLLxUTE6Pg4GC1bNnSdVuX/v37KyEhQbNnz9bs2bM1Y8YMvfjii3I4HBo/frx69uwp\nSZX293wpKSkaP368GjVqpODgYHXv3l2H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T//vc/SVJQUJBeffVVbdiwQQsWLND8+fN12223\nKSYmRi1btrxgWa+88op69uyphIQEHThwQKmpqZo3b56++uorvffee5JULkgCwFkEQwC1V1DQmZE9\nP1xKbtGihb49b71lZWUqKCjQr371K9c0wzAkSWazWYWFhZo4caJCQkJ06tQplZaWSpLatWsnSfrl\nL3+pkpKSKru3d+9ebdq0SR9++KEkqaioSA0aNNBjjz2madOm6cSJExo8eLD72wugzvBJMNyxY4fG\njRunL774QpJUUlKiZ555RitXrpQk9evXT9OnT1dQUJAMw1BGRoYWL14sh8Oh+Ph4paamKjAwUJK0\ncuVK/f3vf9f333+vHj16aObMmWrSpIkvNgNATRQUJIWH+3y1d911l0aPHq0+ffro6quv1kMPPaQm\nTZqoS5custvtOn78uMLDw/Wf//xHzZs312effaajR4/q+eefV2FhodauXesKjQEBARcsPyAgwNV+\nvtatW2vw4MGKi4vT999/r8WLF+u7775Tbm6uXn75ZdntdkVHRys+Pl4mE+MDAP6PVz+VbBiGlixZ\notGjR7v+8pWkjIwM7du3T6tXr9bq1auVl5enBQsWSJIWLlyo7OxsLV++XKtWrdLWrVtdbbt379b0\n6dOVkZGhTZs2qUmTJkpNTfXmJgDAZWnRooWeffZZpaWl6Y9//KMKCwtVUFAgh8OhuLg4/fWvf9UD\nDzwgh8MhSerYsaO+/fZb3XfffZowYYJatWql7777rtLld+rUSc8991yFn0JOTk7Whx9+qBEjRmjM\nmDGKjIxU06ZNdfz4cQ0fPlyJiYkaPXo0oRDAhQwvmj17thEXF2fMmzfPuOmmmwzDMIySkhKjc+fO\nxr59+1zzHTt2zDh8+LBhGIYxdOhQY/Hixa62jz76yBg0aJBhGIbxt7/9zZg8ebKrrbCw0GjTpo1x\n/Phxt/qTk5NT7W2y2WxGTk6OYbPZKp4hL88wpDP/8vKqvb4axcPbXmWtfamW71eOa9+w2WzG0qVL\nje+//97fXan1rqjzRy1HrT3AzXOsJ2tdWSby6ojhkCFDlJWVpQ4dOrimHTx4UA6HQ9u3b9cdd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ynjq1CkFBweXm2axWFRcXOz2Mi5l3orY7fZyP88XYLfLXK01AKjJLnaOqey8\nAfiCpz7ocqWsx1MWzxzgk/UMm7q60rZf/nhU85yP7Xa7jErOI1VlEE8IMAzD8NrSPey1117Thg0b\n9Oqrr7qmTZgwQW3bttW4ceOqfP2WLVu82T0AAIAao2vXrhdMq1Ejhq1bt9Zbb71VbprValVsbKxb\nr6+oAAAAADijRr3H8Oabb1ZJSYnefPNNlZaWasmSJSooKFCvXr383TUAAIAar0ZdSpak3bt364kn\nntCePXt03XXX6YknnlDnzp393S0AAIAar8YFQwAAAHhHjbqUDAAAAO8hGAIAAEASwRAAAABOBEMA\nAABIIhheVE5OjoYNG6auXbuqX79+eueddyRJRUVFGj9+vLp27arevXtr8eLFfu5pzbdq1SoNGjRI\nXbp00Z133ql169ZJotbeUlBQoJtvvlnr16+XRJ29Zf78+brhhhvUpUsX17+cnBzq7QXHjh1TUlKS\nbrzxRt1+++164403JHFse9ry5cvLHc9dunRR27ZtNW3aNGrtBVu3btU999yjG2+8UQMGDNCKFSsk\nefm4NlChH3/80ejevbuxfPlyw+FwGLt27TK6d+9ubNiwwfjzn/9sTJo0ySguLja2b99u3HTTTca2\nbdv83eUaKz8/3+jUqZOxZcsWwzAMY8OGDUZUVJTx/fffU2sv+eMf/2i0bdvW+OSTTwzDMKizl0yc\nONF49dVXL5hOvT2rrKzMuPvuu42nn37aKCkpMfbu3Wt0797d2LJlC7X2sg0bNhi33nqrcfToUWrt\nYadPnzZ69uxpfPjhh4ZhGMZXX31ltG/f3vj222+9WmtGDCtx5MgRRUdHKy4uTvXq1VNUVJR69Oih\nrVu3at26dZowYYLMZrM6duyo2NhYLVu2zN9drrHCwsK0YcMG3XjjjTp9+rQKCgr0i1/8QkFBQdTa\nCxYtWqTg4GC1aNFCknTy5Enq7CXffPON2rVrV24a9fa87du367vvvtOkSZNUv359RUZG6p133lHz\n5s2ptRedPHlSjz76qJ544gldddVV1NrDfvrpJxUWFsrhcMgwDAUE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AHCDcVcyAPwGW1tbWl9fV3d3tyTp7du3+vLli8bGxrI8GQD8jWIIAL/B8fGxhoaGtLe3p5yc\nHJWWlmp4eFglJSXZHg0A0iiGAAAAkMQeQwAAAFyiGAIAAEASxRAAAACXKIYAAACQRDEEAADAJYoh\nAAAAJEl/ATuBE1DdOrpUAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x24e3f184438>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "credit_df.AGE.plot(kind='hist',bins=60)\n",
    "\n",
    "for quantile in quantiles:\n",
    "    qvl = plt.axvline(quantile, color='r')\n",
    "ax.legend([qvl], ['Quantiles'], fontsize=10)\n",
    "\n",
    "ax.set_title('Age Histogram with Quantiles', fontsize=12)\n",
    "ax.set_xlabel('Age', fontsize=12)\n",
    "ax.set_ylabel('Frequency', fontsize=12)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Assign Quartile Bin Labels\n",
    "quantile_labels = ['Q1', 'Q2', 'Q3', 'Q4']\n",
    "credit_df['age_quantile_range'] = pd.qcut(credit_df['AGE'],\n",
    "                                          q=quantile_list)\n",
    "credit_df['age_quantile_label'] = pd.qcut(credit_df['AGE'],\n",
    "                                          q=quantile_list,\n",
    "                                          labels=quantile_labels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>AGE</th>\n",
       "      <th>age_quantile_range</th>\n",
       "      <th>age_quantile_label</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>24</td>\n",
       "      <td>(20.999, 28.0]</td>\n",
       "      <td>Q1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>26</td>\n",
       "      <td>(20.999, 28.0]</td>\n",
       "      <td>Q1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>34</td>\n",
       "      <td>(28.0, 34.0]</td>\n",
       "      <td>Q2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>37</td>\n",
       "      <td>(34.0, 41.0]</td>\n",
       "      <td>Q3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>57</td>\n",
       "      <td>(41.0, 79.0]</td>\n",
       "      <td>Q4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    AGE age_quantile_range age_quantile_label\n",
       "ID                                           \n",
       "1    24     (20.999, 28.0]                 Q1\n",
       "2    26     (20.999, 28.0]                 Q1\n",
       "3    34       (28.0, 34.0]                 Q2\n",
       "4    37       (34.0, 41.0]                 Q3\n",
       "5    57       (41.0, 79.0]                 Q4"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit_df[['AGE','age_quantile_range','age_quantile_label']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Feature Engineering : Categorical Data\n",
    "We have utilized multiple publicly available datasets to better understand categorical attributes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(38, 25)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "battles_df = pd.read_csv('battles.csv')\n",
    "battles_df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>year</th>\n",
       "      <th>attacker_king</th>\n",
       "      <th>attacker_1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Battle of the Golden Tooth</td>\n",
       "      <td>298</td>\n",
       "      <td>Joffrey/Tommen Baratheon</td>\n",
       "      <td>Lannister</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Battle at the Mummer's Ford</td>\n",
       "      <td>298</td>\n",
       "      <td>Joffrey/Tommen Baratheon</td>\n",
       "      <td>Lannister</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Battle of Riverrun</td>\n",
       "      <td>298</td>\n",
       "      <td>Joffrey/Tommen Baratheon</td>\n",
       "      <td>Lannister</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Battle of the Green Fork</td>\n",
       "      <td>298</td>\n",
       "      <td>Robb Stark</td>\n",
       "      <td>Stark</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Battle of the Whispering Wood</td>\n",
       "      <td>298</td>\n",
       "      <td>Robb Stark</td>\n",
       "      <td>Stark</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            name  year             attacker_king attacker_1\n",
       "0     Battle of the Golden Tooth   298  Joffrey/Tommen Baratheon  Lannister\n",
       "1    Battle at the Mummer's Ford   298  Joffrey/Tommen Baratheon  Lannister\n",
       "2             Battle of Riverrun   298  Joffrey/Tommen Baratheon  Lannister\n",
       "3       Battle of the Green Fork   298                Robb Stark      Stark\n",
       "4  Battle of the Whispering Wood   298                Robb Stark      Stark"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "battles_df[['name','year','attacker_king','attacker_1']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Transforming Nominal Features\n",
    "Categorical attributes which ***do not*** have any intrinsic ordering amongst them "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: 'Baratheon',\n",
       " 1: 'Bolton',\n",
       " 2: 'Bracken',\n",
       " 3: 'Brave Companions',\n",
       " 4: 'Brotherhood without Banners',\n",
       " 5: 'Darry',\n",
       " 6: 'Free folk',\n",
       " 7: 'Frey',\n",
       " 8: 'Greyjoy',\n",
       " 9: 'Lannister',\n",
       " 10: 'Stark'}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.preprocessing import LabelEncoder\n",
    "\n",
    "attacker_le = LabelEncoder()\n",
    "attacker_labels = attacker_le.fit_transform(battles_df.attacker_1)\n",
    "attacker_mappings = {index: label for index, label in enumerate(attacker_le.classes_)}\n",
    "attacker_mappings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>year</th>\n",
       "      <th>attacker_king</th>\n",
       "      <th>attacker_1</th>\n",
       "      <th>attacker1_label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Battle of the Golden Tooth</td>\n",
       "      <td>298</td>\n",
       "      <td>Joffrey/Tommen Baratheon</td>\n",
       "      <td>Lannister</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Battle at the Mummer's Ford</td>\n",
       "      <td>298</td>\n",
       "      <td>Joffrey/Tommen Baratheon</td>\n",
       "      <td>Lannister</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Battle of Riverrun</td>\n",
       "      <td>298</td>\n",
       "      <td>Joffrey/Tommen Baratheon</td>\n",
       "      <td>Lannister</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Battle of the Green Fork</td>\n",
       "      <td>298</td>\n",
       "      <td>Robb Stark</td>\n",
       "      <td>Stark</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Battle of the Whispering Wood</td>\n",
       "      <td>298</td>\n",
       "      <td>Robb Stark</td>\n",
       "      <td>Stark</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            name  year             attacker_king attacker_1  \\\n",
       "0     Battle of the Golden Tooth   298  Joffrey/Tommen Baratheon  Lannister   \n",
       "1    Battle at the Mummer's Ford   298  Joffrey/Tommen Baratheon  Lannister   \n",
       "2             Battle of Riverrun   298  Joffrey/Tommen Baratheon  Lannister   \n",
       "3       Battle of the Green Fork   298                Robb Stark      Stark   \n",
       "4  Battle of the Whispering Wood   298                Robb Stark      Stark   \n",
       "\n",
       "   attacker1_label  \n",
       "0                9  \n",
       "1                9  \n",
       "2                9  \n",
       "3               10  \n",
       "4               10  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# assign labels\n",
    "battles_df['attacker1_label'] = attacker_labels\n",
    "battles_df[['name','year','attacker_king','attacker_1','attacker1_label']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Transforming Ordinal Features\n",
    "Categorical attributes which ***have*** an intrinsic ordering amongst them"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>items_sold</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Monday</td>\n",
       "      <td>1.335099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tuesday</td>\n",
       "      <td>12.281317</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Wednesday</td>\n",
       "      <td>7.430103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Thursday</td>\n",
       "      <td>12.461398</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Friday</td>\n",
       "      <td>86.592034</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Saturday</td>\n",
       "      <td>44.415942</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Sunday</td>\n",
       "      <td>130.905837</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  day_of_week  items_sold\n",
       "0      Monday    1.335099\n",
       "1     Tuesday   12.281317\n",
       "2   Wednesday    7.430103\n",
       "3    Thursday   12.461398\n",
       "4      Friday   86.592034\n",
       "5    Saturday   44.415942\n",
       "6      Sunday  130.905837"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sales_df = pd.DataFrame(data={\n",
    "                            'items_sold':abs(np.random.randn(7)*100),\n",
    "                             'day_of_week':['Monday', 'Tuesday',\n",
    "                                            'Wednesday', 'Thursday', \n",
    "                                            'Friday', 'Saturday', \n",
    "                                            'Sunday']})\n",
    "sales_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "day_map = {'Monday': 1, 'Tuesday': 2, \n",
    "           'Wednesday': 3, 'Thursday': 4, \n",
    "           'Friday': 5, 'Saturday': 6, \n",
    "           'Sunday' : 7}\n",
    "\n",
    "sales_df['weekday_label'] = sales_df['day_of_week'].map(day_map)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>items_sold</th>\n",
       "      <th>weekday_label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Monday</td>\n",
       "      <td>1.335099</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tuesday</td>\n",
       "      <td>12.281317</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Wednesday</td>\n",
       "      <td>7.430103</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Thursday</td>\n",
       "      <td>12.461398</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Friday</td>\n",
       "      <td>86.592034</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  day_of_week  items_sold  weekday_label\n",
       "0      Monday    1.335099              1\n",
       "1     Tuesday   12.281317              2\n",
       "2   Wednesday    7.430103              3\n",
       "3    Thursday   12.461398              4\n",
       "4      Friday   86.592034              5"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sales_df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Encoding Categoricals "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "One Hot Encoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import OneHotEncoder\n",
    "\n",
    "day_le = LabelEncoder()\n",
    "day_labels = day_le.fit_transform(sales_df['day_of_week'])\n",
    "sales_df['label_encoder_day_label'] = day_labels\n",
    "\n",
    "# encode day labels using one-hot encoding scheme\n",
    "day_ohe = OneHotEncoder()\n",
    "day_feature_arr = day_ohe.fit_transform(sales_df[['label_encoder_day_label']]).toarray()\n",
    "day_feature_labels = list(day_le.classes_)\n",
    "day_features = pd.DataFrame(day_feature_arr, columns=day_feature_labels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>items_sold</th>\n",
       "      <th>weekday_label</th>\n",
       "      <th>label_encoder_day_label</th>\n",
       "      <th>Friday</th>\n",
       "      <th>Monday</th>\n",
       "      <th>Saturday</th>\n",
       "      <th>Sunday</th>\n",
       "      <th>Thursday</th>\n",
       "      <th>Tuesday</th>\n",
       "      <th>Wednesday</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Monday</td>\n",
       "      <td>1.335099</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tuesday</td>\n",
       "      <td>12.281317</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Wednesday</td>\n",
       "      <td>7.430103</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Thursday</td>\n",
       "      <td>12.461398</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Friday</td>\n",
       "      <td>86.592034</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Saturday</td>\n",
       "      <td>44.415942</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Sunday</td>\n",
       "      <td>130.905837</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  day_of_week  items_sold  weekday_label  label_encoder_day_label  Friday  \\\n",
       "0      Monday    1.335099              1                        1     0.0   \n",
       "1     Tuesday   12.281317              2                        5     0.0   \n",
       "2   Wednesday    7.430103              3                        6     0.0   \n",
       "3    Thursday   12.461398              4                        4     0.0   \n",
       "4      Friday   86.592034              5                        0     1.0   \n",
       "5    Saturday   44.415942              6                        2     0.0   \n",
       "6      Sunday  130.905837              7                        3     0.0   \n",
       "\n",
       "   Monday  Saturday  Sunday  Thursday  Tuesday  Wednesday  \n",
       "0     1.0       0.0     0.0       0.0      0.0        0.0  \n",
       "1     0.0       0.0     0.0       0.0      1.0        0.0  \n",
       "2     0.0       0.0     0.0       0.0      0.0        1.0  \n",
       "3     0.0       0.0     0.0       1.0      0.0        0.0  \n",
       "4     0.0       0.0     0.0       0.0      0.0        0.0  \n",
       "5     0.0       1.0     0.0       0.0      0.0        0.0  \n",
       "6     0.0       0.0     1.0       0.0      0.0        0.0  "
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sales_ohe_df = pd.concat([sales_df, day_features], axis=1)\n",
    "sales_ohe_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Dummy Encoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>items_sold</th>\n",
       "      <th>Monday</th>\n",
       "      <th>Saturday</th>\n",
       "      <th>Sunday</th>\n",
       "      <th>Thursday</th>\n",
       "      <th>Tuesday</th>\n",
       "      <th>Wednesday</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Monday</td>\n",
       "      <td>1.335099</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tuesday</td>\n",
       "      <td>12.281317</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Wednesday</td>\n",
       "      <td>7.430103</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Thursday</td>\n",
       "      <td>12.461398</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Friday</td>\n",
       "      <td>86.592034</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Saturday</td>\n",
       "      <td>44.415942</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Sunday</td>\n",
       "      <td>130.905837</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  day_of_week  items_sold  Monday  Saturday  Sunday  Thursday  Tuesday  \\\n",
       "0      Monday    1.335099       1         0       0         0        0   \n",
       "1     Tuesday   12.281317       0         0       0         0        1   \n",
       "2   Wednesday    7.430103       0         0       0         0        0   \n",
       "3    Thursday   12.461398       0         0       0         1        0   \n",
       "4      Friday   86.592034       0         0       0         0        0   \n",
       "5    Saturday   44.415942       0         1       0         0        0   \n",
       "6      Sunday  130.905837       0         0       1         0        0   \n",
       "\n",
       "   Wednesday  \n",
       "0          0  \n",
       "1          0  \n",
       "2          1  \n",
       "3          0  \n",
       "4          0  \n",
       "5          0  \n",
       "6          0  "
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "day_dummy_features = pd.get_dummies(sales_df['day_of_week'], drop_first=True)\n",
    "pd.concat([sales_df[['day_of_week','items_sold']], day_dummy_features], axis=1)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
